package cn.hzking.gjmall.utils;

import android.content.Context;
import android.content.pm.PackageManager;

/**
 * Created by Administrator on 2018/2/24.
 */

public class AndroidStudioUtils {
    //获取版本号
    public static int getVersionCode(Context context){
        try {
            return context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionCode;
        }catch(PackageManager.NameNotFoundException e){
            return 0;
        }
    }
}
